package com.ctgu.蓝桥杯真题.B组2019;

/**
 * @author: Backdiy
 * @data: 2021/4/10 16:00
 * @desc:
 */
public class D数的分解 {
    public static void main(String[] args) {
        int a = 2019, ans = 0;
        for (int i = 1; i < 2019; i++) {
            for (int j = i + 1; j < 2019; j++) {
                int k = 2019 - i - j;
                if (i != 0 && j != 0 && k != 0 && k > j) {
                    if (!judge(i, j, k)) {
                        ans++;
                    }
                }
            }
        }
        System.out.println(ans);
    }

    static boolean judge(int i, int j, int k) {
        String res = "" + i + j + k;
        return res.contains("2") || res.contains("4");
    }
}
